/**
 * 功能描述 导航
 */
define(function(require, exports, module) {
	var Subnav = require("subnav");

	var contractStat = require("../store/contractStat");

	var instance = {
		initComponent : function(params, widget) {
			var subnav = new Subnav({
				parentNode : ".J-subnav",
				model : {
					title : "签约统计",
					items : [
							{
								id : "signUpDate",
								tip : "签约时间",
								type : "daterange",
								ranges : {
									"今天" : [ moment().startOf("days"),
											moment().endOf("days") ],
									"本月" : [ moment().startOf("month"),
											moment().endOf("month") ],
									"本年" : [ moment().startOf("year"),
											moment().endOf("days") ]
								},
								defaultRange : "本年",
								handler : function(time) {
									widget.get("grid").refresh();
								}
							}, {
								id : "return",
								type : "button",
								text : "返回",
								show : false,
								handler : function() {
									widget.hide([".J-countgrid"]).show([".J-grid"]);
	        			    		widget.get("subnav").show(["signUpDate"]).hide(["return"]);
								}

							} ]
				}
			});
			widget.set("subnav", subnav);
		}
	};
	module.exports = instance;
});
